<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>List</title>
<!-- content inspired by http://www.reynoldsftw.com/2009/04/custom-events-in-jquery-open-doors-to-complex-behaviors/ -->
<script type="text/javascript" src="../js/jquery-1.3.2.js"></script>

<script type="text/javascript">
$(function() {
	// say the container is expandable
	$('div.expandableContainer').bind('toggleContent', function() {
		$(this).find('div.expandable').toggle();
	});
	
	// bind the expansion/contraction to the toggleElement
	$('div.toggleElement').click(function() {
		$(this).parent().trigger('toggleContent');
	});
});
</script>
</head>
<body>
<div class="expandableContainer">
	<div class="toggleElement">Open/Close</div>
	<h1>Title</h1>
	<div class="expandable">Expandable content</div>
</div> <!-- :expandableContainer -->
</body>
</html>